﻿using Ewell.BizComponent.Reg.UI.VM;
using System.Windows;

namespace Ewell.BizComponent.Reg.UI
{
    /// <summary>
    /// OutRegFrm.xaml 的交互逻辑
    /// </summary>
    public partial class PersonCreateFrm : Window
    {
        public PersonCreateVm vm { get; set; }
        public PersonCreateFrm()
        {
            InitializeComponent();
            this.Topmost = true;
        }
        public PersonCreateFrm(PersonCreateVm vm): this()
        {
            this.vm = vm;
            this.vm.localWindow = this;
            DataContext = this.vm;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //if(this.vm == null)
            //{
            //    this.vm = new PersonCreateVm();
            //}
            ////查询医保费别
            //DictPatientTypeDubboService dictPatientTypeDubboService = new DictPatientTypeDubboService();
            //var gateWayResult = dictPatientTypeDubboService.queryPagePatientType.Post<List<PatientTypeVm>>(new DictPatientTypeQueryRequest
            //{
            //    athenaMenuId = this.vm.menuId,
            //    enabledFlag = "1",
            //}).CheckState();
            //this.vm.patientTypeList = gateWayResult.@object;
            //this.vm.selectedPatientType= this.vm.patientTypeList?.FirstOrDefault();
            //this.vm.sexList = new List<PersonSexVm>()
            //{
            //    new PersonSexVm()
            //    {
            //        no=1,
            //        code="1",
            //        name="男",
            //    },
            //    new PersonSexVm()
            //    {
            //        no=2,
            //        code="2",
            //        name="女",
            //    },
            //    new PersonSexVm()
            //    {
            //        no=0,
            //        code="0",
            //        name="未知的性别",
            //    },
            //    new PersonSexVm()
            //    {
            //        no=9,
            //        code="9",
            //        name="未说明的性别",
            //    },
            //};
            //this.vm.selectedSex= this.vm.sexList?.FirstOrDefault();
            //this.DataContext=this.vm;
        }
    }
}
